# eric7.Plugins.VcsPlugins.vcsMercurial.HgLogBrowserDialog

Module implementing a dialog to browse the log history.

### Global Attributes

COLORNAMES
COLORS
LIGHTCOLORS

### Classes

HgLogBrowserDialog | Class implementing a dialog to browse the log history.

### Functions

None

## HgLogBrowserDialog

Class implementing a dialog to browse the log history.

### Derived from

QWidget, Ui_HgLogBrowserDialog

### Class Attributes

AuthorColumn
BookmarksColumn
BranchColumn
ClosedIndicator
DateColumn
GraftedRe
GraftedTemplate
IconColumn
LargefilesCacheL
LargefilesCacheW
MessageColumn
PathSeparatorRe
PhaseColumn
RevisionColumn
TagsColumn

### Class Methods

None

### Methods

HgLogBrowserDialog | Constructor
__actionMode | Private method to get the selected action mode.
__addFinishCallback | Private method to add a method to be called once the process finished.
__bookmarkActTriggered | Private slot to bookmark the selected revision.
__bookmarkMoveActTriggered | Private slot to move a bookmark to the selected revision.
__branchColor | Private method to calculate a color for a given branch name.
__bundleActTriggered | Private slot to create a changegroup file.
__closeHeadsActTriggered | Private slot to close the selected head revisions.
__filterLogs | Private method to filter the log entries.
__findItem | Private slot to find an item matching the entered criteria.
__finish | Private slot called when the process finished or the user pressed the button.
__generateDetailsTableText | Private method to generate an HTML table with the details of the given changeset.
__generateDiffs | Private slot to generate diff outputs for the selected item.
__generateEdges | Private method to generate edge info for the give data.
__generateIcon | Private method to generate an icon containing the revision tree for the given data.
__generateLogItem | Private method to generate a log tree entry.
__generatorFinished | Private slot connected to the finished signal of the diff generator.
__getClosedBranches | Private method to get the list of closed branches.
__getColor | Private method to get the (rotating) name of the color given an index.
__getHeads | Private method to get the list of all heads.
__getLogEntries | Private method to retrieve log entries from the repository.
__getParents | Private method to get the parents of the currently viewed file/directory.
__getRevisionOfTag | Private method to get the revision of a tag.
__gpgSignActTriggered | Private slot to sign the selected revisions.
__gpgVerifyActTriggered | Private slot to verify the signatures of a selected revisions.
__graftActTriggered | Private slot to handle the Copy Changesets action.
__identifyProject | Private method to determine the revision of the project directory.
__initActionsMenu | Private method to initialize the actions menu.
__initData | Private method to (re-)initialize some data.
__lfPullActTriggered | Private slot to pull large files of selected revisions.
__mergeActTriggered | Private slot to merge the working directory with the selected changeset.
__modifyForLargeFiles | Private method to convert the displayed file name for a large file.
__phaseActTriggered | Private slot to handle the Change Phase action.
__prepareFieldSearch | Private slot to prepare the filed search data.
__processBuffer | Private method to process the buffered output of the hg log command.
__pullActTriggered | Private slot to pull all or selected changes from a remote repository.
__pushActTriggered | Private slot to push changes to a remote repository up to a selected changeset.
__pushAllActTriggered | Private slot to push all changes to a remote repository.
__reloadGeometry | Private method to restore the geometry.
__resetUI | Private method to reset the user interface.
__resizeColumnsFiles | Private method to resize the changed files tree columns.
__resizeColumnsLog | Private method to resize the log tree columns.
__resortFiles | Private method to resort the changed files tree.
__restoreSplitterStates | Private method to restore the state of the various splitters.
__revisionClicked | Private slot to handle the anchorClicked signal of the changeset details pane.
__selectAllActTriggered | Private method to select or unselect all log entries.
__selectBranches | Private slot to select the branches to be shown.
__showError | Private slot to show some error.
__stripActTriggered | Private slot to strip changesets from the repository.
__switchActTriggered | Private slot to switch the working directory to the selected revision.
__tagActTriggered | Private slot to tag the selected revision.
__unbundleActTriggered | Private slot to apply the currently previewed bundle file.
__updateDetailsAndFiles | Private slot to update the details and file changes panes.
__updateFilesTree | Private method to update the files tree with changes of the given item.
__updateSbsSelectLabel | Private slot to update the enabled status of the diff buttons.
__updateToolMenuActions | Private slot to update the status of the tool menu actions and the tool menu button.
closeEvent | Protected slot implementing a close event handler.
col2x | Local function to calculate a x-position for a column.
on_branchCombo_activated | Private slot called, when a new branch is selected.
on_buttonBox_clicked | Private slot called by a button of the button box clicked.
on_diffSelectLabel_linkActivated | Private slot to handle the selection of a diff target.
on_downButton_clicked | Private slot to move the current item down one entry.
on_fieldCombo_activated | Private slot called, when a new filter field is selected.
on_filesTree_currentItemChanged | Private slot called, when the current item of the files tree changes.
on_findNextButton_clicked | Private slot to find the next item matching the entered criteria.
on_findPrevButton_clicked | Private slot to find the previous item matching the entered criteria.
on_fromDate_dateChanged | Private slot called, when the from date changes.
on_logTree_currentItemChanged | Private slot called, when the current item of the log tree changes.
on_logTree_itemSelectionChanged | Private slot called, when the selection has changed.
on_modeComboBox_currentIndexChanged | Private slot to react on mode changes.
on_nextButton_clicked | Private slot to handle the Next button.
on_refreshButton_clicked | Private slot to refresh the log.
on_rxEdit_returnPressed | Private slot handling a press of the Return key in the rxEdit input.
on_rxEdit_textChanged | Private slot called, when a filter expression is entered.
on_saveLabel_linkActivated | Private slot to handle the selection of the save link.
on_sbsSelectLabel_linkActivated | Private slot to handle selection of a side-by-side link.
on_stopCheckBox_clicked | Private slot called, when the stop on copy/move checkbox is clicked.
on_toDate_dateChanged | Private slot called, when the from date changes.
on_upButton_clicked | Private slot to move the current item up one entry.
show | Public slot to show the dialog.
start | Public slot to start the hg log command.

### Static Methods

None

#### HgLogBrowserDialog (Constructor)

HgLogBrowserDialog(vcs, mode="", parent=None)

Constructor

vcs (Hg)
  reference to the vcs object
mode (str (one of log, full_log, incoming, outgoing))
  mode of the dialog
parent (QWidget)
  parent widget

#### HgLogBrowserDialog.__actionMode

__actionMode()

Private method to get the selected action mode.

Return:
  selected action mode (one of 'filter' or 'find')

Return Type:
  str

#### HgLogBrowserDialog.__addFinishCallback

__addFinishCallback(callback)

Private method to add a method to be called once the process finished.

The callback methods are invoke in a FIFO style and are consumed. If a callback method needs to be called again, it must be added again.

callback (function)
  callback method

#### HgLogBrowserDialog.__bookmarkActTriggered

__bookmarkActTriggered()

Private slot to bookmark the selected revision.

#### HgLogBrowserDialog.__bookmarkMoveActTriggered

__bookmarkMoveActTriggered()

Private slot to move a bookmark to the selected revision.

#### HgLogBrowserDialog.__branchColor

__branchColor(branchName)

Private method to calculate a color for a given branch name.

branchName (str)
  name of the branch

Return:
  name of the color to use

Return Type:
  str

#### HgLogBrowserDialog.__bundleActTriggered

__bundleActTriggered()

Private slot to create a changegroup file.

#### HgLogBrowserDialog.__closeHeadsActTriggered

__closeHeadsActTriggered()

Private slot to close the selected head revisions.

#### HgLogBrowserDialog.__filterLogs

__filterLogs()

Private method to filter the log entries.

#### HgLogBrowserDialog.__findItem

__findItem(backwards=False, interactive=False)

Private slot to find an item matching the entered criteria.

backwards (bool)
  flag indicating to search backwards
interactive (bool)
  flag indicating an interactive search

#### HgLogBrowserDialog.__finish

__finish()

Private slot called when the process finished or the user pressed the button.

#### HgLogBrowserDialog.__generateDetailsTableText

__generateDetailsTableText(itm)

Private method to generate an HTML table with the details of the given changeset.

itm (QTreeWidgetItem)
  reference to the item the table should be based on

Return:
  HTML table containing details

Return Type:
  str

#### HgLogBrowserDialog.__generateDiffs

__generateDiffs(parent=1)

Private slot to generate diff outputs for the selected item.

parent (int)
  number of parent to diff against

#### HgLogBrowserDialog.__generateEdges

__generateEdges(rev, parents)

Private method to generate edge info for the give data.

rev (int)
  revision to calculate edge info for
parents (list of int)
  list of parent revisions

Return:
  tuple containing the column and color index for the given node and a list of tuples indicating the edges between the given node and its parents

Return Type:
  tuple of (int, int, [(int, int, int), ...])

#### HgLogBrowserDialog.__generateIcon

__generateIcon(column, bottomedges, topedges, dotColor, currentRev, closed, isPushableDraft, )

Private method to generate an icon containing the revision tree for the given data.

column (int)
  column index of the revision
bottomedges (list of tuples of (int, int, int))
  list of edges for the bottom of the node
topedges (list of tuples of (int, int, int))
  list of edges for the top of the node
dotColor (QColor)
  color to be used for the dot
currentRev (bool)
  flag indicating to draw the icon for the current revision
closed (bool)
  flag indicating to draw an icon for a closed branch
isPushableDraft (bool)
  flag indicating an entry of phase 'draft', that can by pushed

Return:
  icon for the node

Return Type:
  QIcon

#### HgLogBrowserDialog.__generateLogItem

__generateLogItem(author, date, message, revision, changedPaths, parents, branches, tags, phase, bookmarks, latestTag, canPush=False, )

Private method to generate a log tree entry.

author (str)
  author info
date (str)
  date info
message (list of str)
  text of the log message
revision (str)
  revision info
changedPaths (dict)
  list of dictionary objects containing info about the changed files/directories
parents (list of int)
  list of parent revisions
branches (list of str)
  list of branches
tags (str)
  list of tags
phase (str)
  phase of the entry
bookmarks (str)
  list of bookmarks
latestTag (list of str)
  the latest tag(s) reachable from the changeset
canPush (bool)
  flag indicating that changesets can be pushed

Return:
  reference to the generated item

Return Type:
  QTreeWidgetItem

#### HgLogBrowserDialog.__generatorFinished

__generatorFinished()

Private slot connected to the finished signal of the diff generator.

#### HgLogBrowserDialog.__getClosedBranches

__getClosedBranches()

Private method to get the list of closed branches.

#### HgLogBrowserDialog.__getColor

__getColor(n)

Private method to get the (rotating) name of the color given an index.

n (int)
  color index

Return:
  color name

Return Type:
  str

#### HgLogBrowserDialog.__getHeads

__getHeads()

Private method to get the list of all heads.

#### HgLogBrowserDialog.__getLogEntries

__getLogEntries(startRev=None, noEntries=0)

Private method to retrieve log entries from the repository.

startRev (int or str)
  revision number to start from
noEntries (int)
  number of entries to get (0 = default)

#### HgLogBrowserDialog.__getParents

__getParents(rev)

Private method to get the parents of the currently viewed file/directory.

rev (str)
  revision number to get parents for

Return:
  list of parent revisions

Return Type:
  list of int

#### HgLogBrowserDialog.__getRevisionOfTag

__getRevisionOfTag(tag)

Private method to get the revision of a tag.

tag (str)
  tag name

Return:
  tuple containing the revision and changeset ID

Return Type:
  tuple of (str, str)

#### HgLogBrowserDialog.__gpgSignActTriggered

__gpgSignActTriggered()

Private slot to sign the selected revisions.

#### HgLogBrowserDialog.__gpgVerifyActTriggered

__gpgVerifyActTriggered()

Private slot to verify the signatures of a selected revisions.

#### HgLogBrowserDialog.__graftActTriggered

__graftActTriggered()

Private slot to handle the Copy Changesets action.

#### HgLogBrowserDialog.__identifyProject

__identifyProject()

Private method to determine the revision of the project directory.

#### HgLogBrowserDialog.__initActionsMenu

__initActionsMenu()

Private method to initialize the actions menu.

#### HgLogBrowserDialog.__initData

__initData()

Private method to (re-)initialize some data.

#### HgLogBrowserDialog.__lfPullActTriggered

__lfPullActTriggered()

Private slot to pull large files of selected revisions.

#### HgLogBrowserDialog.__mergeActTriggered

__mergeActTriggered()

Private slot to merge the working directory with the selected changeset.

#### HgLogBrowserDialog.__modifyForLargeFiles

__modifyForLargeFiles(filename)

Private method to convert the displayed file name for a large file.

filename (str)
  file name to be processed

Return:
  processed file name

Return Type:
  str

#### HgLogBrowserDialog.__phaseActTriggered

__phaseActTriggered()

Private slot to handle the Change Phase action.

#### HgLogBrowserDialog.__prepareFieldSearch

__prepareFieldSearch()

Private slot to prepare the filed search data.

Return:
  tuple of field index, search expression and flag indicating that the field index is a data role

Return Type:
  tuple of (int, str, bool)

#### HgLogBrowserDialog.__processBuffer

__processBuffer()

Private method to process the buffered output of the hg log command.

#### HgLogBrowserDialog.__pullActTriggered

__pullActTriggered(selectedOnly=False)

Private slot to pull all or selected changes from a remote repository.

selectedOnly (bool (optional))
  flag indicating to pull the selected changes only (defaults to False)

#### HgLogBrowserDialog.__pushActTriggered

__pushActTriggered()

Private slot to push changes to a remote repository up to a selected changeset.

#### HgLogBrowserDialog.__pushAllActTriggered

__pushAllActTriggered()

Private slot to push all changes to a remote repository.

#### HgLogBrowserDialog.__reloadGeometry

__reloadGeometry()

Private method to restore the geometry.

#### HgLogBrowserDialog.__resetUI

__resetUI()

Private method to reset the user interface.

#### HgLogBrowserDialog.__resizeColumnsFiles

__resizeColumnsFiles()

Private method to resize the changed files tree columns.

#### HgLogBrowserDialog.__resizeColumnsLog

__resizeColumnsLog()

Private method to resize the log tree columns.

#### HgLogBrowserDialog.__resortFiles

__resortFiles()

Private method to resort the changed files tree.

#### HgLogBrowserDialog.__restoreSplitterStates

__restoreSplitterStates()

Private method to restore the state of the various splitters.

#### HgLogBrowserDialog.__revisionClicked

__revisionClicked(url)

Private slot to handle the anchorClicked signal of the changeset details pane.

url (QUrl)
  URL that was clicked

#### HgLogBrowserDialog.__selectAllActTriggered

__selectAllActTriggered(select=True)

Private method to select or unselect all log entries.

select (bool)
  flag indicating to select all entries

#### HgLogBrowserDialog.__selectBranches

__selectBranches(stateFilter=None)

Private slot to select the branches to be shown.

stateFilter (list of str (optional))
  list of state filters ("", "C" or "I") to be presented for selection (None or empty list means all) (defaults to None)

#### HgLogBrowserDialog.__showError

__showError(out)

Private slot to show some error.

out (str)
  error to be shown

#### HgLogBrowserDialog.__stripActTriggered

__stripActTriggered()

Private slot to strip changesets from the repository.

#### HgLogBrowserDialog.__switchActTriggered

__switchActTriggered()

Private slot to switch the working directory to the selected revision.

#### HgLogBrowserDialog.__tagActTriggered

__tagActTriggered()

Private slot to tag the selected revision.

#### HgLogBrowserDialog.__unbundleActTriggered

__unbundleActTriggered()

Private slot to apply the currently previewed bundle file.

#### HgLogBrowserDialog.__updateDetailsAndFiles

__updateDetailsAndFiles()

Private slot to update the details and file changes panes.

#### HgLogBrowserDialog.__updateFilesTree

__updateFilesTree(parent, itm)

Private method to update the files tree with changes of the given item.

parent (QTreeWidget or QTreeWidgetItem)
  parent for the items to be added
itm (QTreeWidgetItem)
  reference to the item the update should be based on

#### HgLogBrowserDialog.__updateSbsSelectLabel

__updateSbsSelectLabel()

Private slot to update the enabled status of the diff buttons.

#### HgLogBrowserDialog.__updateToolMenuActions

__updateToolMenuActions()

Private slot to update the status of the tool menu actions and the tool menu button.

#### HgLogBrowserDialog.closeEvent

closeEvent(e)

Protected slot implementing a close event handler.

e (QCloseEvent)
  close event

#### HgLogBrowserDialog.col2x

col2x(radius)

Local function to calculate a x-position for a column.

col (int)
  column number
radius (int)
  radius of the indicator circle

#### HgLogBrowserDialog.on_branchCombo_activated

on_branchCombo_activated(index)

Private slot called, when a new branch is selected.

index (int)
  index of the selected entry

#### HgLogBrowserDialog.on_buttonBox_clicked

on_buttonBox_clicked(button)

Private slot called by a button of the button box clicked.

button (QAbstractButton)
  button that was clicked

#### HgLogBrowserDialog.on_diffSelectLabel_linkActivated

on_diffSelectLabel_linkActivated(link)

Private slot to handle the selection of a diff target.

link (str)
  activated link

#### HgLogBrowserDialog.on_downButton_clicked

on_downButton_clicked()

Private slot to move the current item down one entry.

#### HgLogBrowserDialog.on_fieldCombo_activated

on_fieldCombo_activated(index)

Private slot called, when a new filter field is selected.

index (int)
  index of the selected entry

#### HgLogBrowserDialog.on_filesTree_currentItemChanged

on_filesTree_currentItemChanged(current, previous)

Private slot called, when the current item of the files tree changes.

current (QTreeWidgetItem)
  reference to the new current item
previous (QTreeWidgetItem)
  reference to the old current item

#### HgLogBrowserDialog.on_findNextButton_clicked

on_findNextButton_clicked()

Private slot to find the next item matching the entered criteria.

#### HgLogBrowserDialog.on_findPrevButton_clicked

on_findPrevButton_clicked()

Private slot to find the previous item matching the entered criteria.

#### HgLogBrowserDialog.on_fromDate_dateChanged

on_fromDate_dateChanged(date)

Private slot called, when the from date changes.

date (QDate)
  new date

#### HgLogBrowserDialog.on_logTree_currentItemChanged

on_logTree_currentItemChanged(current, previous)

Private slot called, when the current item of the log tree changes.

current (QTreeWidgetItem)
  reference to the new current item
previous (QTreeWidgetItem)
  reference to the old current item

#### HgLogBrowserDialog.on_logTree_itemSelectionChanged

on_logTree_itemSelectionChanged()

Private slot called, when the selection has changed.

#### HgLogBrowserDialog.on_modeComboBox_currentIndexChanged

on_modeComboBox_currentIndexChanged(index)

Private slot to react on mode changes.

index (int)
  index of the selected entry

#### HgLogBrowserDialog.on_nextButton_clicked

on_nextButton_clicked()

Private slot to handle the Next button.

#### HgLogBrowserDialog.on_refreshButton_clicked

on_refreshButton_clicked(addNext=False)

Private slot to refresh the log.

addNext (bool)
  flag indicating to get a second batch of log entries as well

#### HgLogBrowserDialog.on_rxEdit_returnPressed

on_rxEdit_returnPressed()

Private slot handling a press of the Return key in the rxEdit input.

#### HgLogBrowserDialog.on_rxEdit_textChanged

on_rxEdit_textChanged(txt)

Private slot called, when a filter expression is entered.

txt (str)
  filter expression

#### HgLogBrowserDialog.on_saveLabel_linkActivated

on_saveLabel_linkActivated(link)

Private slot to handle the selection of the save link.

link (str)
  activated link

#### HgLogBrowserDialog.on_sbsSelectLabel_linkActivated

on_sbsSelectLabel_linkActivated(link)

Private slot to handle selection of a side-by-side link.

link (str)
  text of the selected link

#### HgLogBrowserDialog.on_stopCheckBox_clicked

on_stopCheckBox_clicked(_checked)

Private slot called, when the stop on copy/move checkbox is clicked.

_checked (bool)
  flag indicating the state of the check box (unused)

#### HgLogBrowserDialog.on_toDate_dateChanged

on_toDate_dateChanged(date)

Private slot called, when the from date changes.

date (QDate)
  new date

#### HgLogBrowserDialog.on_upButton_clicked

on_upButton_clicked()

Private slot to move the current item up one entry.

#### HgLogBrowserDialog.show

show()

Public slot to show the dialog.

#### HgLogBrowserDialog.start

start(name=None, bundle=None, isFile=False, noEntries=0)

Public slot to start the hg log command.

name (str)
  file/directory name to show the log for
bundle (str)
  name of a bundle file
isFile (bool)
  flag indicating log for a file is to be shown
noEntries (int)
  number of entries to get (0 = default)

Up